{extend name="public:base"}
{block name="body"}
<body>
	<form class="layui-form layui-form-pane" action="">
        <div class="mainBox">
            <div class="main-container">
                <div class="layui-form-item">
                    <label class="layui-form-label">账户昵称</label>
                    <div class="layui-input-block">
                        <input type="text"  value="{$info.account_name|default=''}" lay-verify="require" autocomplete="off"
                            placeholder="" class="layui-input" readonly>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">账户卡号</label>
                    <div class="layui-input-block">
                        <input type="text"  value="{$info.account_card|default=''}" lay-verify="require" autocomplete="off"
                            placeholder="" class="layui-input" readonly>
                    </div>
                </div>
                
                <div class="layui-form-item">
                    <label class="layui-form-label">绑定手机</label>
                    <div class="layui-input-block">
                        <input type="text"  value="{$info.account_phone|default=''}" lay-verify="require" autocomplete="off"
                            placeholder="" class="layui-input" readonly >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">账户余额</label>
                    <div class="layui-input-block">
                        <input type="text"  value="{$info.balance|default=''}" lay-verify="require" autocomplete="off"
                            placeholder="" class="layui-input" readonly>
                    </div>
                </div>
                
                <div class="layui-form-item">
                    <label class="layui-form-label">充值金额</label>
                    <div class="layui-input-block">
                        <input type="text" name="recharge_amount" value="{$info.recharge_amount|default='0'}" lay-verify="require" autocomplete="off"
                            placeholder="" class="layui-input" >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">赠送金额</label>
                    <div class="layui-input-block">
                        <input type="text" name="extra_amount"  value="{$info.extra_amount|default='0'}" lay-verify="require" autocomplete="off"
                            placeholder="" class="layui-input" >
                    </div>
                </div>
               
            </div>    
        </div>
        <div class="bottom">
            <div class="button-container">
                <input type="hidden" name="id" value="{$info.id|default=''}">
                <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
                    lay-filter="form-save">
                    <i class="layui-icon layui-icon-ok"></i>
                    提交
                </button>
                <button type="reset" class="pear-btn pear-btn-sm">
                    <i class="layui-icon layui-icon-refresh"></i>
                    重置
                </button>
            </div>
        </div>   
    </form>
</body>
{/block} 
{block name="custom"}{/block}
{block name="script"}
<script>
    layui.use(['form','jquery','element','select'], function() {
        let form = layui.form;
        let $ = layui.jquery;
        let select = layui.select;
        form.on('submit(form-save)', function(data) {
            $.ajax({
                url: '{:url("recharge")}',
                data: JSON.stringify(data.field),
                dataType: 'json',
                contentType: 'application/json',
                type: 'post',
                success: function(result) {
                    if (result.code == '1') {
                        layer.msg(result.msg, {
                            icon: 1,
                            time: 1000
                        }, function() {
                            parent.layer.close(parent.layer.getFrameIndex(window
                                .name)); //关闭当前页
                            parent.layui.table.reload("table-list");
                        });
                    } else {
                        layer.msg(result.msg, {
                            icon: 2,
                            time: 1000
                        });
                    }
                }
            })
            return false;
        });
    })
</script>
{/block}